<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js"></script>
		<style type="text/css">
			.d1 {
				width: 200px;
				height: 200px;
				background-color: orange;
			}
			
			.d2 {
				width: 200px;
				height: 200px;
				background-color: green;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<d1></d1>
			<d2></d2>
		</div>
		<template id="t1">
			<div class="d1">
				<span>全局组件1</span>
			</div>
		</template>
		<template id="t2">
			<div class="d2">
				<span>全局组件2</span>
			</div>
		</template>
		<script type="text/javascript">
			//全局组件
			Vue.component('d1', {
				template: '#t1'
			});
			Vue.component('d2', {
				template: '#t2'
			});
			new Vue({
				el: '#app',
			})
		</script>
	</body>
</html>
